#!/bin/bash

set -e

echo "test custom.debian10 go runtime ..."
rm -rf ./go/code/go.sum
export fc_component_function_name=go1-$(uname)-$(uname -m)
s deploy -y -t ./go/s.yaml
s invoke -e '{"hello":"fc custom.debian10 go"}' -t ./go/s.yaml
s local invoke -e '{"hello":"fc custom.debian10 go"}' -t ./go/s.yaml
s info -t ./go/s.yaml
s remove -y -t ./go/s.yaml
rm -rf ./go/code/target

echo "test custom.debian10 python runtime ..."
rm -rf ./python/code/3rd-packages
rm -rf ./python/code/__pycache__
export fc_component_function_name=python310-$(uname)-$(uname -m)
s build -t ./python/s.yaml
s local invoke -e '{"hello":"fc custom.debian10 python"}' -t ./python/s.yaml
s deploy -y -t ./python/s.yaml
s invoke -e '{"hello":"fc custom.debian10 python"}' -t ./python/s.yaml
s info -t ./python/s.yaml
s remove -y -t ./python/s.yaml